﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HomeWork5
{
    public class Product : IComparable
    {
        //产品名称
        public string ProductName { get; set; }
        //产品价格
        public double ProductPrice { get; set; }
        public Product(string ProductName, double ProductPrice)
        {
            this.ProductName = ProductName;
            this.ProductPrice = ProductPrice;
        }
        public Product() { }
        public int CompareTo(object obj)
        {
            Product product = obj as Product;
            if (product == null)
                throw new NotImplementedException();
            return this.ProductName.CompareTo(product.ProductName);
        }
        public override string ToString()
        {
            return this.ProductName;
        }
    }
}
